﻿<%-- QBRatingAppPart.aspx ---------------------------------------------------
   *
   * Informatix Football Apps
   * QB Passing Efficiency Calculator (SharePoint App Part)
   *
   * © 2013 Jason Barkes - http://jbarkes.blogspot.com
   --------------------------------------------------------------------------%>

<%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<WebPartPages:AllowFraming ID="AllowFraming" runat="server" />

<!-- Use the SharePoint styles -->
<SharePoint:CssRegistration runat="server" name="default" />
<SharePoint:CssLink runat="server" />

<html>
<head>
    <title>QB Rating App Part</title>

    <!-- CSS Links -->
    <link rel="stylesheet" type="text/css" href="../Content/App.css" />

    <!-- Scripts -->
    <script type="text/javascript" src="/_layouts/MicrosoftAjax.js"></script>
    <script type="text/javascript" src="../Scripts/jquery-1.6.2.min.js"></script>
    <script type="text/javascript" src="../Scripts/AppPart.js"></script>

    <script type="text/javascript">
        var hostUrl;

        /* Load the SharePoint libraries */
        $(document).ready(function () {

            /* Get the URI decoded URLs */
            hostUrl = decodeURIComponent(getQueryStringParam("SPHostUrl"));

            /* The js file URL format: web_url/_layouts/15/resource_file */
            var jsBase = hostUrl + "/_layouts/15/";

            /* Load the js files and call our jsMain function */
            $.getScript(jsBase + "SP.Core.js",
                function () {
                    $.getScript(jsBase + "SP.Runtime.js",
                        function () {
                            $.getScript(jsBase + "SP.js", jsMain);
                        }
                    );
                }
            );
        });

        /* Main function */
        function jsMain() {
            sharePointReady();
        }
                
    </script>
</head>

<body>

    <!-- Passing stats input -->
    <table class="qbr-stats-table">
        <tr>
            <td>Completions:</td>
            <td><input type="text" id="ctl_completions" size="5" maxlength="5"></td>
        </tr>
        <tr>
            <td>Attempts:</td>
            <td><input type="text" id="ctl_attempts" size="5" maxlength="5"></td>
        </tr>
        <tr>
            <td>Passing Yards:</td>
            <td><input type="text" id="ctl_yards" size="5" maxlength="5"></td>
        </tr>
        <tr>
            <td>Passing TDs:</td>
            <td><input type="text" id="ctl_tds" size="5" maxlength="5"></td>
        </tr>
        <tr>
            <td>Interceptions:</td>
            <td><input type="text" id="ctl_ints" size="5" maxlength="5"></td>
        </tr>
        <tr>
            <td>NCAA Rating:</td>
            <td><input type="text" id="ctl_ncaaRating" class="result" size="5" maxlength="5" readonly></td>
        </tr>
        <tr>
            <td>NFL Rating:</td>
            <td><input type="text" id="ctl_nflRating" class="result" size="5" maxlength="5" readonly title="Perfect rating is 158.3"></td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="BUTTON" id="btn_reset" value="Reset" onclick="calc_reset();">
                <input type="BUTTON" id="btn_calc" value="Calculate" onclick="calc_ratings();">
            </td>
        </tr>
    </table>

</body>
</html>
